<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/avatar100.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/avatar100.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/avatar30.png">
  <link rel="mask-icon" href="/images/avatar100.png" color="#222">

<link rel="stylesheet" href="/css/main.css">

<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">
<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"fengwenyi.gitee.io","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":"valine","storage":true,"lazyload":false,"nav":null,"activeClass":"valine"},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":true,"preload":true},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="使用Hexo+Github+Next终于将自己的博客搭建起来了。今年三月开始折腾Hexo，无数次的尝试，无数次的失败，看着别人酷炫的博客，自己也是暗暗发誓一定要折腾出自己的。今天他来了。这里记录一下折腾的过程。">
<meta property="og:type" content="article">
<meta property="og:title" content="基于Hexo搭建个人博客">
<meta property="og:url" content="https://fengwenyi.gitee.io/2021/04/06/hexo-blog/index.html">
<meta property="og:site_name" content="冯文议博客">
<meta property="og:description" content="使用Hexo+Github+Next终于将自己的博客搭建起来了。今年三月开始折腾Hexo，无数次的尝试，无数次的失败，看着别人酷炫的博客，自己也是暗暗发誓一定要折腾出自己的。今天他来了。这里记录一下折腾的过程。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://fengwenyi.gitee.io/2021/04/06/hexo-blog/2021040601.png">
<meta property="article:published_time" content="2021-04-06T15:28:44.000Z">
<meta property="article:modified_time" content="2021-04-06T15:52:31.363Z">
<meta property="article:author" content="Erwin Feng">
<meta property="article:tag" content="Hexo">
<meta property="article:tag" content="博客">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://fengwenyi.gitee.io/2021/04/06/hexo-blog/2021040601.png">

<link rel="canonical" href="https://fengwenyi.gitee.io/2021/04/06/hexo-blog/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>基于Hexo搭建个人博客 | 冯文议博客</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">冯文议博客</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">专注于程序设计与开发</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签<span class="badge">12</span></a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类<span class="badge">3</span></a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档<span class="badge">7</span></a>

  </li>
        <li class="menu-item menu-item-links">

    <a href="/links/" rel="section"><i class="fa fa-link fa-fw"></i>友链</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

  <a href="https://github.com/fengwenyi" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://fengwenyi.gitee.io/2021/04/06/hexo-blog/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://portrait.gitee.com/uploads/avatars/user/382/1147388_fengwenyi_1589149473.png">
      <meta itemprop="name" content="Erwin Feng">
      <meta itemprop="description" content="我是冯文议，软件开发工程师，专注于程序设计与开发。开源项目：JavaLib、api-result。喜欢看电影、听音乐、自驾游。">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="冯文议博客">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          基于Hexo搭建个人博客
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2021-04-06 23:28:44 / 修改时间：23:52:31" itemprop="dateCreated datePublished" datetime="2021-04-06T23:28:44+08:00">2021-04-06</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Hexo/" itemprop="url" rel="index"><span itemprop="name">Hexo</span></a>
                </span>
            </span>

          
            <span id="/2021/04/06/hexo-blog/" class="post-meta-item leancloud_visitors" data-flag-title="基于Hexo搭建个人博客" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/04/06/hexo-blog/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/04/06/hexo-blog/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>使用Hexo+Github+Next终于将自己的博客搭建起来了。今年三月开始折腾Hexo，无数次的尝试，无数次的失败，看着别人酷炫的博客，自己也是暗暗发誓一定要折腾出自己的。今天他来了。这里记录一下折腾的过程。</p>
<p><img src="/2021/04/06/hexo-blog/2021040601.png" alt="摘要图片"></p>
<span id="more"></span>

<h2 id="第一步，学习Hexo"><a href="#第一步，学习Hexo" class="headerlink" title="第一步，学习Hexo"></a>第一步，学习Hexo</h2><p>点击，进入：<a target="_blank" rel="noopener" href="https://hexo.io/">Hexo官网</a>。</p>
<h4 id="Hexo，快速、简洁且高效的博客框架"><a href="#Hexo，快速、简洁且高效的博客框架" class="headerlink" title="Hexo，快速、简洁且高效的博客框架"></a>Hexo，快速、简洁且高效的博客框架</h4><ul>
<li>超快速度</li>
</ul>
<p>Node.js 所带来的超快生成速度，让上百个页面在几秒内瞬间完成渲染。</p>
<ul>
<li>支持 Markdown</li>
</ul>
<p>Hexo 支持 GitHub Flavored Markdown 的所有功能，甚至可以整合 Octopress 的大多数插件。</p>
<ul>
<li>一键部署</li>
</ul>
<p>只需一条指令即可部署到 GitHub Pages, Heroku 或其他网站。</p>
<ul>
<li>丰富的插件</li>
</ul>
<p>Hexo 拥有强大的插件系统，安装插件可以让 Hexo 支持 Jade, CoffeeScript。</p>
<h4 id="Hexo文档"><a href="#Hexo文档" class="headerlink" title="Hexo文档"></a>Hexo文档</h4><p>如果您在使用过程中遇到问题，请查看 <a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/docs/troubleshooting">问题解答</a> 中的解答，或者在 <a target="_blank" rel="noopener" href="https://github.com/hexojs/hexo/issues">GitHub</a>、<a target="_blank" rel="noopener" href="https://groups.google.com/forum/#!forum/hexo">Google Group</a> 上提问。</p>
<p>1、使用Markdown进行写作。</p>
<p>2、需要Node.js和Git。</p>
<p>3、Hexo命令。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 工程初始化</span></span><br><span class="line">hexo init &lt;folder&gt;</span><br><span class="line"><span class="comment"># 进入工程</span></span><br><span class="line"><span class="built_in">cd</span> &lt;folder&gt;</span><br><span class="line"><span class="comment"># 编译</span></span><br><span class="line">npm install</span><br><span class="line"><span class="comment"># 创建文档</span></span><br><span class="line">hexo new [layout] &lt;title&gt;</span><br><span class="line"><span class="comment"># clean</span></span><br><span class="line">hexo clean</span><br><span class="line"><span class="comment"># 生成静态文件</span></span><br><span class="line">hexo g</span><br><span class="line"><span class="comment"># 推送</span></span><br><span class="line">hexo d</span><br></pre></td></tr></table></figure>

<p>4、配置文件 <code>_config.yml</code></p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Site</span></span><br><span class="line"><span class="attr">title:</span> <span class="string">网站标题</span></span><br><span class="line"><span class="attr">subtitle:</span> <span class="string">网站副标题</span></span><br><span class="line"><span class="attr">description:</span> <span class="string">网站描述</span></span><br><span class="line"><span class="attr">keywords:</span> <span class="string">关键字</span></span><br><span class="line"><span class="attr">author:</span> <span class="string">作者</span></span><br><span class="line"><span class="attr">language:</span> <span class="string">语言</span></span><br><span class="line"><span class="attr">timezone:</span> <span class="string">时区</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># URL</span></span><br><span class="line"><span class="attr">url:</span> <span class="string">网站的URL</span></span><br><span class="line"><span class="attr">root:</span> <span class="string">根目录</span></span><br><span class="line"><span class="attr">permalink:</span> <span class="string">文章链接样式</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Extensions</span></span><br><span class="line"><span class="attr">theme:</span> <span class="string">主题</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Deployment</span></span><br><span class="line"><span class="attr">deploy:</span></span><br><span class="line">  <span class="attr">type:</span> <span class="string">类型</span></span><br><span class="line">  <span class="attr">repo:</span> <span class="string">仓库地址</span></span><br><span class="line">  <span class="attr">branch:</span> <span class="string">仓库分支</span></span><br></pre></td></tr></table></figure>

<h2 id="第二步，搭建博客"><a href="#第二步，搭建博客" class="headerlink" title="第二步，搭建博客"></a>第二步，搭建博客</h2><p>1、安装Node.js</p>
<p>2、安装Hexo</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install -g hexo-cli </span><br></pre></td></tr></table></figure>

<p>3、创建工程</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo init [project]</span><br></pre></td></tr></table></figure>

<p>4、本地运行</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> [project]</span><br><span class="line">hexo g</span><br><span class="line">hexo s</span><br></pre></td></tr></table></figure>

<p>他会告诉，可以访问：<a target="_blank" rel="noopener" href="http://localhost:4000/">http://localhost:4000</a></p>
<p>5、创建远程仓库</p>
<p>这里，说一下，仓库的名称格式很严格，规则为：**[your github username].github.io**</p>
<p><code>一定得是这样，否则你就跟我一样，慢慢折腾吧！</code></p>
<p>6、修改配置 <code>_config.yml</code></p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">deploy:</span></span><br><span class="line">  <span class="attr">type:</span> <span class="string">git</span></span><br><span class="line">  <span class="attr">repo:</span> [<span class="string">your</span> <span class="string">github</span> <span class="string">project</span> <span class="string">repository</span> <span class="string">git/url</span> <span class="string">address</span>]</span><br><span class="line">  <span class="attr">branch:</span> <span class="string">master</span></span><br></pre></td></tr></table></figure>

<p>7、推送</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo clean &amp;&amp; hexo g &amp;&amp; hexo d</span><br></pre></td></tr></table></figure>

<h2 id="第三步，效果预览"><a href="#第三步，效果预览" class="headerlink" title="第三步，效果预览"></a>第三步，效果预览</h2><h4 id="访问-repo-github-io"><a href="#访问-repo-github-io" class="headerlink" title="访问 [repo].github.io"></a>访问 [repo].github.io</h4><h4 id="绑定自己的域名"><a href="#绑定自己的域名" class="headerlink" title="绑定自己的域名"></a>绑定自己的域名</h4><p>1、域名绑定</p>
<p>2、然后指定自定义域名</p>
<h2 id="第四步，优化"><a href="#第四步，优化" class="headerlink" title="第四步，优化"></a>第四步，优化</h2><h4 id="自定义主题"><a href="#自定义主题" class="headerlink" title="自定义主题"></a>自定义主题</h4><h4 id="访问量"><a href="#访问量" class="headerlink" title="访问量"></a>访问量</h4><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Post wordcount display settings</span></span><br><span class="line"><span class="comment"># Dependencies: https://github.com/willin/hexo-wordcount</span></span><br><span class="line"><span class="attr">post_wordcount:</span></span><br><span class="line">  <span class="attr">item_text:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">wordcount:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">min2read:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">totalcount:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">separated_meta:</span> <span class="literal">true</span></span><br></pre></td></tr></table></figure>

<h4 id="评论"><a href="#评论" class="headerlink" title="评论"></a>评论</h4><p>使用 <code>gitment</code>, <code>valine</code></p>
<h2 id="第五步，踩坑"><a href="#第五步，踩坑" class="headerlink" title="第五步，踩坑"></a>第五步，踩坑</h2><h4 id="问题1：完全按照教程，结果出现404页面？"><a href="#问题1：完全按照教程，结果出现404页面？" class="headerlink" title="问题1：完全按照教程，结果出现404页面？"></a>问题1：完全按照教程，结果出现404页面？</h4><blockquote>
<p>ERROR Deployer not found: git</p>
</blockquote>
<p>未执行 <strong>npm install hexo-deployer-git –save</strong> 命令</p>
<blockquote>
<p>页面不能正常显示，或者404</p>
</blockquote>
<p>我折腾了一下午，原因是：我随便取得名字。</p>
<blockquote>
<p>无法执行 hexo 命令</p>
</blockquote>
<p>运行 <code>hexo init [project]</code> 后，未执行：cd [project]。</p>
<p>页面404，收到GitHub发的邮件，内容如下：</p>
<blockquote>
<p>The tag <code>fancybox</code> on line 77 in <code>themes/landscape/README.md</code> is not a recognized Liquid tag. For more information, see <a target="_blank" rel="noopener" href="https://help.github.com/en/articles/page-build-failed-unknown-tag-error">https://help.github.com/en/articles/page-build-failed-unknown-tag-error</a>.</p>
</blockquote>
<p>解决方案，see <a target="_blank" rel="noopener" href="https://github.com/hexojs/hexo/issues/2590">hexo github #2590</a></p>
<h4 id="问题2：统计无效？"><a href="#问题2：统计无效？" class="headerlink" title="问题2：统计无效？"></a>问题2：统计无效？</h4><p>统计用的是不蒜子，无效的原因，作者说的非常清楚，因为域名更换了，之前的域名无法使用，作者也是非常无奈，与客服沟通无果，付费也无法解决。</p>
<p>首先需要先找到NexT下引用不蒜子统计的方法。文件路径为/theme/next/layout/_third-party/analytics/busuanzi-counter.swig文件。</p>
<p>替换为 <code>https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js</code>。</p>
<h4 id="问题3：图片问题"><a href="#问题3：图片问题" class="headerlink" title="问题3：图片问题"></a>问题3：图片问题</h4><p><strong>使用图片</strong></p>
<blockquote>
<p>那么配置的顺序则为:<br>设置站点配置_config.yml:将post_asset_folder: false改为post_asset_folder: true<br>执行 npm install hexo-asset-image –save 装插件<br>执行hexo new [xxxx],生成xxxx.md和xxxx文件夹<br>把要引用的图片拷贝到xxxx文件夹中<br>使用 <code>![](xxxx/example.jpg)</code>来引用本地图片</p>
</blockquote>
<p><strong>摘要图片</strong></p>
<h4 id="问题4：文章摘要"><a href="#问题4：文章摘要" class="headerlink" title="问题4：文章摘要"></a>问题4：文章摘要</h4><p>使用<code>&lt;!-- more --&gt;</code>断开即可。</p>

    </div>

    
    
    
        <div class="reward-container">
  <div></div>
  <button onclick="var qr = document.getElementById('qr'); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
    打赏
  </button>
  <div id="qr" style="display: none;">
      
      <div style="display: inline-block;">
        <img src="/images/wechatpay.jpg" alt="Erwin Feng 微信支付">
        <p>微信支付</p>
      </div>
      
      <div style="display: inline-block;">
        <img src="/images/alipay.jpg" alt="Erwin Feng 支付宝">
        <p>支付宝</p>
      </div>

  </div>
</div>

        

  <div class="followme">
    <p>欢迎关注我的其它发布渠道</p>

    <div class="social-list">

        <div class="social-item" align="center">
          <img src="/images/qrcode_wx_public_fengwenyi.jpg" height="150">
          <span class="label">微信公众号</span>
        </div>
    </div>
  </div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/Hexo/" rel="tag"># Hexo</a>
              <a href="/tags/%E5%8D%9A%E5%AE%A2/" rel="tag"># 博客</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item"></div>
      <div class="post-nav-item">
    <a href="/2021/04/14/vue-admin-pro-01/" rel="next" title="后端管理系统开发（一）：登录篇">
      后端管理系统开发（一）：登录篇 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%AC%AC%E4%B8%80%E6%AD%A5%EF%BC%8C%E5%AD%A6%E4%B9%A0Hexo"><span class="nav-number">1.</span> <span class="nav-text">第一步，学习Hexo</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Hexo%EF%BC%8C%E5%BF%AB%E9%80%9F%E3%80%81%E7%AE%80%E6%B4%81%E4%B8%94%E9%AB%98%E6%95%88%E7%9A%84%E5%8D%9A%E5%AE%A2%E6%A1%86%E6%9E%B6"><span class="nav-number">1.0.1.</span> <span class="nav-text">Hexo，快速、简洁且高效的博客框架</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Hexo%E6%96%87%E6%A1%A3"><span class="nav-number">1.0.2.</span> <span class="nav-text">Hexo文档</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%AC%AC%E4%BA%8C%E6%AD%A5%EF%BC%8C%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2"><span class="nav-number">2.</span> <span class="nav-text">第二步，搭建博客</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%AC%AC%E4%B8%89%E6%AD%A5%EF%BC%8C%E6%95%88%E6%9E%9C%E9%A2%84%E8%A7%88"><span class="nav-number">3.</span> <span class="nav-text">第三步，效果预览</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E8%AE%BF%E9%97%AE-repo-github-io"><span class="nav-number">3.0.1.</span> <span class="nav-text">访问 [repo].github.io</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E7%BB%91%E5%AE%9A%E8%87%AA%E5%B7%B1%E7%9A%84%E5%9F%9F%E5%90%8D"><span class="nav-number">3.0.2.</span> <span class="nav-text">绑定自己的域名</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%AC%AC%E5%9B%9B%E6%AD%A5%EF%BC%8C%E4%BC%98%E5%8C%96"><span class="nav-number">4.</span> <span class="nav-text">第四步，优化</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E8%87%AA%E5%AE%9A%E4%B9%89%E4%B8%BB%E9%A2%98"><span class="nav-number">4.0.1.</span> <span class="nav-text">自定义主题</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E8%AE%BF%E9%97%AE%E9%87%8F"><span class="nav-number">4.0.2.</span> <span class="nav-text">访问量</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E8%AF%84%E8%AE%BA"><span class="nav-number">4.0.3.</span> <span class="nav-text">评论</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%AC%AC%E4%BA%94%E6%AD%A5%EF%BC%8C%E8%B8%A9%E5%9D%91"><span class="nav-number">5.</span> <span class="nav-text">第五步，踩坑</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E9%97%AE%E9%A2%981%EF%BC%9A%E5%AE%8C%E5%85%A8%E6%8C%89%E7%85%A7%E6%95%99%E7%A8%8B%EF%BC%8C%E7%BB%93%E6%9E%9C%E5%87%BA%E7%8E%B0404%E9%A1%B5%E9%9D%A2%EF%BC%9F"><span class="nav-number">5.0.1.</span> <span class="nav-text">问题1：完全按照教程，结果出现404页面？</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E9%97%AE%E9%A2%982%EF%BC%9A%E7%BB%9F%E8%AE%A1%E6%97%A0%E6%95%88%EF%BC%9F"><span class="nav-number">5.0.2.</span> <span class="nav-text">问题2：统计无效？</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E9%97%AE%E9%A2%983%EF%BC%9A%E5%9B%BE%E7%89%87%E9%97%AE%E9%A2%98"><span class="nav-number">5.0.3.</span> <span class="nav-text">问题3：图片问题</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E9%97%AE%E9%A2%984%EF%BC%9A%E6%96%87%E7%AB%A0%E6%91%98%E8%A6%81"><span class="nav-number">5.0.4.</span> <span class="nav-text">问题4：文章摘要</span></a></li></ol></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Erwin Feng"
      src="https://portrait.gitee.com/uploads/avatars/user/382/1147388_fengwenyi_1589149473.png">
  <p class="site-author-name" itemprop="name">Erwin Feng</p>
  <div class="site-description" itemprop="description">我是冯文议，软件开发工程师，专注于程序设计与开发。开源项目：JavaLib、api-result。喜欢看电影、听音乐、自驾游。</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">7</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">3</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">12</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/fengwenyi" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;fengwenyi" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://gitee.com/fengwenyi" title="Gitee → https:&#x2F;&#x2F;gitee.com&#x2F;fengwenyi" rel="noopener" target="_blank"><i class="fab fa-git fa-fw"></i>Gitee</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        
  <div class="beian"><a href="https://beian.miit.gov.cn/" rel="noopener" target="_blank">蜀ICP备17004656号 </a>
  </div>

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Erwin Feng</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : true,
      notify     : true,
      appId      : 'TmVgfqdEKDu3mW6CCqoopJzc-gzGzoHsz',
      appKey     : 'nLPReImvGVaHrUVM3r7OqJh8',
      placeholder: "说点什么",
      avatar     : 'mp',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : true,
      lang       : 'zh-cn' || 'zh-cn',
      path       : location.pathname,
      recordIP   : true,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
